package com.glink.manage.mqtt.common;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;


@Component
public class HttpClientConfig {
    public static int CONNECT_TIMEOUT = 60000;

    public static int REQUEST_TIMEOUT = -1;
    public static int SOCKET_TIMEOUT = 600000;
    public static int MAX_PER_ROUTE = 200;
    public static int MAX_TOTAL = 500;
    public static int RETRY_COUNT = 3;

    @Value("${httpClient.connectTimeout:60000}")
    public void setConnectTimeout(int connectTimeout) {
        CONNECT_TIMEOUT = connectTimeout;
    }

    @Value("${httpClient.requestTimeout:-1}")
    public void setRequestTimeout(int requestTimeout) {
        REQUEST_TIMEOUT = requestTimeout;
    }

    @Value("${httpClient.socketTimeout:60000}")
    public void setSocketTimeout(int socketTimeout) {
        SOCKET_TIMEOUT = socketTimeout;
    }

    @Value("${httpClient.maxPerRoute:200}")
    public void setMaxPerRoute(int maxPerRoute) {
        MAX_PER_ROUTE = maxPerRoute;
    }

    @Value("${httpClient.maxTotal:1000}")
    public void setMaxTotal(int maxTotal) {
        MAX_TOTAL = maxTotal;
    }

    @Value("${httpClient.retryCount:3}")
    public void setRetryCount(int retryCount) {
        RETRY_COUNT = retryCount;
    }
}
 

 